package controller

import (
	"github.com/gin-gonic/gin"
	"goods-srv/internal/biz/vo"
	"net/http"
)

type Index struct {
	Router
}

// 健康检测
// @Summary		 检测服务是否可用
// @Description  通过调用改接口，可检测出服务是否可用
// @Tags         health
// @Accept       json
// @Produce      json
// @Router       /health [get]
func (controller Index) get(c *gin.Context) {
	apiRes := vo.New()
	c.JSON(http.StatusOK, apiRes)
}

func NewIndex(router *gin.Engine) {
	c := Index{}

	// http://localhost:8080/health
	router.GET("/health", c.get)
}
